Repository navigation
[Core] Add node-local LMCache pools for vLLM - #1283
fredericsun wants to merge 7 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
|
|
||
| #### LMCache ProviderManaged Pool | ||
|
|
||
| The example overrides the cache server image and resource requests. |
There was a problem hiding this comment.
🟡 Nit: oeps/0010-kv-cache-server-component/oep.yaml still says status: provisional, but this PR merges the implementation of the LMCache ProviderManaged profile (new KVCachePool API, controller, webhook validation, Helm packaging). Per the OEP process, the design should be marked implementable (with reviewer/approver sign-off recorded) before the implementation lands — or this PR should note why it is intentionally landing against a provisional design. Updating the status in oep.yaml alongside this change would keep the process record consistent.
There was a problem hiding this comment.
Reviewed the full diff: new KVCachePool API and controller, LMCache provider reconciliation, engine binding/rendering, admission validation, RBAC, and Helm packaging. The reconciliation is careful about ownership (pool-UID labels, owner-UID checks on the connection ConfigMap, delete preconditions), the finalizer correctly waits out draining Deployments/ReplicaSets/Pods, and the int/float normalization through k8s JSON avoids a patch loop with the provider CRD. Test coverage is strong (CRD/CEL validation, fake + optional envtest lifecycle, full isvc reconcile round-trip, Helm render and live lifecycle scripts). Two 🟡 nits posted inline: the hardcoded cluster.local domain in the connection endpoint check, and OEP-0010 still being marked provisional.
Add the pool, runtime connector and service reference types, generated clients and schemas, doctor discovery, and a pool manifest. Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
Create one DaemonSet per pool and publish its local Service endpoint. Keep the server while any service or draining workload uses the pool. Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
Configure the merged vLLM engine template and report binding status. Include a runnable example and cache recovery guidance. Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
2078b68 to
f9f48d6
Compare
|
👋 The PR description doesn't fully follow
Please update the PR description so reviewers have the context they need. |
Apply the desired manifest with the existing field owner, forcing the same fields and retaining the resource-version precondition. Read the server response back into the child for DaemonSet readiness checks. Exercise ConfigMap drift repair alongside an independently owned key. Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
Set privileged to false so reconciliation also updates existing DaemonSets. Preserve host IPC and the configured NVIDIA RuntimeClass. Cover fresh templates and upgrades from the prior privileged template. Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
Use the Kubernetes default for new NodeLocal servers. Cover the rendered template and the newly reconciled DaemonSet. Drop the upgrade fixture for experimental pools. Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
Signed-off-by: Yue Sun <25257139+fredericsun@users.noreply.github.com>
What this PR does
A namespace-scoped
KVCachePoolwithdeploymentMode: NodeLocalruns one LMCache multiprocess server per selected node. OME owns the DaemonSet, a Service that routes to ready endpoints on the same node, and a ConfigMap with the connection settings. AServingRuntimedeclares support forLMCacheMPConnector. AnInferenceServicereferences the pool withspec.kvCachePool.name, and OME configures the vLLM engine when rendering its Pod template. OEP-0010 · Sample manifests and smoke testWhy we need it
A vLLM Pod can reuse KV entries from another Pod on the same node when both connect to the same LMCache server. A pool gives platform administrators one place to select those nodes and budget host memory. Service owners can then reference the pool by name, and deleting one service keeps the cache available to other consumers.
How to test
From the repository root, point
KUBEBUILDER_ASSETSat Kubernetes 1.35 envtest binaries (kube-apiserverandetcd) and run:TestLMCachePoolLifecyclesubmitsexample.invalid/LMCache:test, checks that the pool reportsInvalidSpecwithout creating a DaemonSet, then corrects the image and verifies that reconciliation proceeds. To check actual KV reuse, follow the GPU prerequisites and request probe in the sample walkthrough.Functional validation
Two single-Pod vLLM services, A and B, served Llama 3.1 8B Instruct on the same GPU node and referenced one pool. The test used LMCache v0.5.1 and disabled vLLM local prefix caching. Each request shared a 1,024-token prefix and varied the final token. We measured the change in
vllm:external_prefix_cache_hits_totalfor each request and checked the server's store and retrieve logs.We repeated all three scenarios with privileged mode disabled on the LMCache server. A test-only admission webhook removed the server container's
privilegedfield. The original and replacement server Pod templates matched the baseline in every other field, includinghostIPC: trueandruntimeClassName: nvidia.OME omits
securityContext.privilegedfrom new LMCache server containers. Control-plane tests verify that the generated template omits the field, the reconciled DaemonSet has privileged mode disabled, and the Pod uses host IPC and the configured RuntimeClass.When a vLLM Pod may need a restart
The server keeps its L1 entries and GPU registrations in process memory. After replacement, each existing worker must tell the new server how to access its GPU KV tensors. In this run the client heartbeat observed an unhealthy-to-healthy transition, which triggered re-registration. If a replacement happens between successful heartbeats, the v0.5.1 client can miss the change. The engine can keep serving completions while the server reports an unregistered GPU context and repeated requests still have zero external hits. Restarting the affected vLLM Pod re-registers it. A cold miss immediately after server replacement is expected. LMCache upstream issue #4642
Checklist
make testpasses locally with Go 1.26.7 atee4b88e0.